Repository navigation
Conversation
nodered/device/remove looked the device up with DeviceRegistry.async_get_device, which Home Assistant deprecated in 2026.9 and which stops working in 2027.8. Use async_get_device_by_identifier with the Node-RED config entry instead, and keep async_get_device on Home Assistant before 2026.8, which does not have it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #436.
Summary
nodered/device/removelooked the device up withDeviceRegistry.async_get_device, which Home Assistant deprecated in 2026.9 (home-assistant/core#178465). The existing remove test logs it on Home Assistant 2026.10.4:The handler now calls
async_get_device_by_identifier((DOMAIN, node_id), entry.entry_id)for the Node-RED config entry. The integration allows only one entry, and its devices are created for that entry. If no entry exists, nothing is removed and the command still succeeds.hacs.jsonstill allows Home Assistant 2024.5, andasync_get_device_by_identifierwas only added in 2026.8 (home-assistant/core#176879). On older versions the handler keeps callingasync_get_device.Testing
pytestwith the CI flags: 198 passed on Home Assistant 2026.10.4, which is what theha-latestjob installs (pytest-homeassistant-custom-component 0.13.375 pins it). Also 198 passed on 2026.7.4 (pytest-homeassistant-custom-component 0.13.348), which runs theasync_get_devicefallback.test_websocket_device_remove_does_not_use_deprecated_lookupfails onmainbecause the warning above is logged, and passes with this change.pre-commit run --all-files(ruff check, ruff format, check-json) passed.async_get_device_by_identifiersignature there is the same as in 2026.8 to 2026.10.🤖 Generated with Claude Code